# -*- coding: utf-8 -*-
# @Time    : 2020/3/4 下午1:46
# @Author  : lilong

"""
以下是工具类：执行具体动作
"""


class Page():
    """电子书一页的内容"""

    def __init__(self, pageNum):
        self.__pageNum = pageNum

    def getContent(self):
        return "第 " + str(self.__pageNum) + " 页的内容..."


class Catalogue():
    """目录结构"""

    def __init__(self, title):
        self.__title = title
        self.__chapters = []
        self.setChapter("第一章")
        self.setChapter("第二章")

    def setChapter(self, title):
        self.__chapters.append(title)

    def showInfo(self):
        print("标题：" + self.__title)
        for chapter in self.__chapters:
            print(chapter)


##——————————————以下是第三方pdf解析库的类————————————————————————##


class Outline():
    """第三方PDF解析库的目录类"""
    pass


class PdfPage():
    """PDF页"""

    def __init__(self, pageNum):
        self.__pageNum = pageNum

    def getPageNum(self):
        return self.__pageNum


class ThirdPdf():
    """第三方PDF解析库"""

    def __init__(self):
        self.__pageSize = 0

    def open(self, filePath):
        print("第三方解析PDF文件：" + filePath)
        self.__pageSize = 1000
        return True

    def getOutline(self):
        return Outline()

    def pageSize(self):
        return self.__pageSize

    def page(self, index):
        return PdfPage(index)
